﻿package
{
	import flash.display.Sprite;
	import flash.geom.Rectangle;
	
	
	public class FallingRain extends Sprite
	{
		private var rect:Rectangle;
		private var tmpSize:Number;
		public function FallingRain(rect:Rectangle)
		{
			this.rect = rect;
			//1
			this.graphics.lineStyle(1,0xeeeeff);
			this.graphics.moveTo(0,0);
			this.graphics.lineTo(0,Math.random()*100+5);
			
			//2
			this.x = 220+Math.random() * (rect.width-400);
			this.y = -20;
			
			//3
			this.z = Math.random()*500 - 245;
			
			//4
			//tmpSize = 300/(300+this.z);
			//this.scaleX = tmpSize;
			//this.scaleY = tmpSize;
			this.alpha = 0.8;
			
			
		}
		
		public function fall():void
		{
			this.y +=35;
			this.x -=1;
			
			if (this.y >rect.bottom)
			{
				//this.
				//this.y = Math.random()*(-200);
			}
			
		}
	}

}